
<?php	
	
	class review extends database
	{
		var $connection = '';	

		function review()
		{
			parent::database();
		}
	
		function GetListPaging()
		{						
			$this->setQuery("set names utf8");
			$this->query();
			return $sql = "Select v.*, c.*, p.* from vnf_review v
            INNER JOIN vnf_customer c ON v.customer_id = c.CustomerNo 
            INNER JOIN vnf_product p ON v.product_id = p.ProductNo ";				
			//return $pager;
			//$rs = $pager->paginate();
	//Loop through the result set
				
			/*$this->setQuery($sql);
			$value = $this->loadAllRow();
			return $value;*/
		}
		
		function GetList()
		{						
			$this->setQuery("set names utf8");
			$this->query();		
			$sql = "Select v.*, c.*, p.* from vnf_review v
            INNER JOIN vnf_customer c ON v.customer_id = c.CustomerNo 
            INNER JOIN vnf_product p ON v.product_id = p.ProductNo ";			
			$this->setQuery($sql);
			$value = $this->loadAllRow();
			return $value;
		}
		
		function UpdateReview($activeYN, $id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Update vnf_review set `activeYN` =  '".$activeYN."' ";
			$sql .= " where review_id=".$id;			
			$this->setQuery($sql);
			$this->query();
		}
		
		function GetOneReview($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Select * from vnf_review where review_id=".$id."";
			$this->setQuery($sql);
			$row = $this->loadOneRow();
			return $row;
		}
		
		function DeleteReview($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Delete from vnf_review";
			$sql .= " where review_id=".$id;			
			
			$this->setQuery($sql);
			$this->query();
		}
	
		
	}
?>